package com.rocketmq;

import org.apache.rocketmq.client.apis.ClientConfiguration;
import org.apache.rocketmq.client.apis.SessionCredentialsProvider;
import org.apache.rocketmq.client.apis.StaticSessionCredentialsProvider;

public abstract class Client {

    protected String accessKey = "EnvMkhnt9K8YMZOc";

    protected String secretKey = "Tlco599yyz5Y1Z26";

    protected String endpoints = "rmq-cn-20p38fyig03.cn-hangzhou.rmq.aliyuncs.com:8080";

    protected ClientConfiguration getConfig() {
        SessionCredentialsProvider sessionCredentialsProvider = new StaticSessionCredentialsProvider(accessKey, secretKey);
        return ClientConfiguration.newBuilder()
                .setEndpoints(endpoints)
                .setCredentialProvider(sessionCredentialsProvider)
                .build();
    }
}